<template>
  <div
    class="m_t_b_10p xd-Cinziqao-Consult-ConsultDetail"
    style="float: left; width: 100%"
  >
    <div class="consult-detail-bg"></div>
    <div class="container" style="margin: 100px auto">
      <el-row>
        <el-col :span="4">
          <div class="block">
            <el-avatar
              :size="180"
              shape="square"
              src="@/assets/imgs/teacher.png"
            >
              <img :src="detail.avatar" />
            </el-avatar>
          </div>
        </el-col>
        <el-col :span="14" style="padding-left: 20px">
          <span style="font-weight: 400; font-size: 30px">{{
            detail.trueName
          }}</span>
          <div style="margin-top: 10px">
            <!-- 资深心理咨询师、国家高级沙盘游戏咨询师 -->
            {{ detail.briefQualify }}
          </div>
          <div style="margin-top: 20px">
            <table>
              <tr>
                <td style="width: 160px; color: #939191">服务过</td>
                <td style="color: #939191">收到感情信</td>
              </tr>
              <tr>
                <td>
                  <span style="font-size: 26px; color: #cb2c21">{{detail.appointSum}}</span> 人
                </td>
                <td>
                  <span style="font-size: 26px; color: #cb2c21">{{
                    detail.thankLetterSum
                  }}</span>
                  封
                </td>
              </tr>
            </table>
          </div>
        </el-col>
        <el-col :span="6" style="padding-top: 106px">
          <el-button
            round
            style="width: 120px; color: #cb2c21; border: 1px solid"
            @click="addAttention"
            v-if="detail.attention == 0"
            >关注</el-button
          >
          <el-button
            type="primary"
            round
            style="width: 120px"
            @click="cancelAttention"
            v-if="detail.attention == 1"
            >已关注</el-button
          >
          <el-button
            round
            style="width: 120px; color: #cb2c21; border: 1px solid"
            @click="doPrivateLetter"
            >私信</el-button
          >
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="17">
          <el-card class="box-card m_t_b_5px" shadow="hover">
            <div slot="header">
              <div class="tag" style="color: #cb2c21; font-weight: bold">
                基本信息
              </div>
            </div>
            <div style="line-height: 32px">
              <div>
                <span style="font-weight: bold; font-size: 18px">认证资质</span
                >·从业{{ detail.jobYear }}
                <!-- 16年 -->
              </div>
              <div style="color: #a7a5a5" v-html="detail.certQualify"></div>
              <!-- 国家二级咨询师<br />
                国家高级沙盘游戏咨询师<br />
                国际催眠治疗师<br />
                华人心理分析联合会B级沙盘游戏咨询师 -->

              <div style="font-weight: bold; font-size: 18px; margin-top: 12px">
                擅长方向
              </div>
              <div>
                <!-- 情绪管理恐惧、焦虑、空心病、孤独、抑郁<br />
                人际关系社交障碍、讨好人格、社会适应难、缺乏安全感、社交回避<br />
                亲子教育厌学、学习压力、孤僻、考试焦虑、注意力 -->
                <div v-html="detail.goodDirection"></div>
              </div>
              <div style="font-weight: bold; font-size: 18px; margin-top: 12px">
                咨询对象
              </div>
              <div v-html="detail.adviser"></div>
              <!-- 儿童、青少年、中年人、学生、留学生、职场人、第三者、伴侣/夫妻、孕产妇、LGBTQ、精神康复者 -->
            </div>
          </el-card>
          <el-card class="box-card m_t_b_5px" shadow="hover">
            <div slot="header">
              <div class="tag" style="color: #cb2c21; font-weight: bold">
                感谢信
                <span style="color: #a7a5a5; font-size: 14px; margin-left: 10px"
                  >收到{{ thankLetterList.length }}封来访者的感谢信</span
                >
              </div>
              <el-button
                type="primary"
                style="margin-left: 720px"
                @click="doAddThankLetter"
                >感谢信</el-button
              >
            </div>
            <div
              style="line-height: 32px"
              v-for="item in thankLetterListTop5"
              :key="item.letterId"
            >
              <div>
                <div>
                  <span
                    v-if="item.anonymity == 0"
                    style="float: left; margin-bottom: 10px; font-weight: bold"
                    >匿名</span
                  >
                  <span style="float: right">{{ item.createTime }}</span>
                </div>
                <div
                  style="
                    background: #ebe9ebb8;
                    padding: 10px 10px;
                    clear: both;
                    border-radius: 10px;
                  "
                >
                  {{ item.letterContent }}
                </div>
              </div>
            </div>
            <div
              style="line-height: 32px; text-align: center; padding-top: 15px"
              v-if="thankLetterList.length > 5"
            >
              <el-button
                @click="showThankLetterAll"
                round
                style="width: 150px; color: #cb2c21; border-color: #cb2c21"
                v-if="isShowThankLetterAll == true"
                >查看全部</el-button
              >
              <el-button
                @click="closeThankLetterAll"
                round
                style="width: 150px; color: #cb2c21; border-color: #cb2c21"
                v-if="isShowThankLetterAll == false"
                >收起</el-button
              >
            </div>
          </el-card>
          <el-card class="box-card m_t_b_5px" shadow="hover">
            <div slot="header">
              <div class="tag" style="color: #cb2c21; font-weight: bold">
                心理专栏
              </div>
            </div>
            <div style="line-height: 32px">
              <div>
                <div>
                  <span style="float: left; margin: 0px 10px; font-weight: bold"
                    >文章（{{ articalList.length }}）</span
                  >
                  <span style="color: #ccc" v-if="articalList.length == 0"
                    >暂无文章</span
                  >
                  <div style="clear: both"></div>
                  <div
                    style="margin-left: 100px; cursor: pointer"
                    v-for="item in articalList"
                    :key="item.scienceId"
                    @click="goNewsDetail(item.scienceId)"
                  >
                    {{ item.scienceTitle }}
                  </div>
                </div>
                <el-divider></el-divider>
                <div>
                  <span style="float: left; margin: 0px 10px; font-weight: bold"
                    >回答（{{ questionAnswerList.length }}）</span
                  >
                </div>
                <div v-for="item in questionAnswerList" :key="item.questionId">
                  {{ item.questionTitle }}
                  <div
                    style="
                      padding: 10px 10px 0px 100px;
                      clear: both;
                      border-radius: 10px;
                      color: #a9a5a5;
                    "
                  >
                    {{ item.answerContent }}
                  </div>
                </div>

                <div
                  style="
                    line-height: 32px;
                    text-align: center;
                    padding-top: 15px;
                  "
                  v-if="questionAnswerList.length > 5"
                >
                  <el-button
                    @click="showQuestionAnswerAll"
                    round
                    style="width: 150px; color: #cb2c21; border-color: #cb2c21"
                    v-if="isShowQuestionAnswerAll"
                    >查看全部</el-button
                  >
                  <el-button
                    @click="closeQuestionAnswerAll"
                    round
                    style="width: 150px; color: #cb2c21; border-color: #cb2c21"
                    v-if="!isShowQuestionAnswerAll"
                    >收起</el-button
                  >
                </div>

                <el-divider></el-divider>
                <div>
                  <span style="float: left; margin: 0px 10px; font-weight: bold"
                    >访谈（0）</span
                  >
                  <span style="color: #ccc">暂无访谈</span>
                </div>
              </div>
            </div>
          </el-card>

          <el-card class="box-card m_t_b_5px" shadow="hover">
            <div slot="header">
              <div class="tag" style="color: #cb2c21; font-weight: bold">
                个人简介
              </div>
            </div>
            <div style="line-height: 18px">
              <!-- <div> 
                 <img src="@/assets/imgs/teacher-info.png" />
               </div> -->
              <div style="clear: both">
                <div v-html="detail.personProfile"></div>
              </div>
              <!-- <div style="font-size:14px;">
                【工作经验】<br/>
                2007年开始，全职在本市专业心理咨询机构从事心理咨询、心理分析工作15年，周咨询量瑞定在30个以上，至今墨积咨询量超过10000小时，目前每年至少1000小时的咨询时数。浙江大学心埋能康教育专业，接受个人精神分析性治疗超过500小时井持织进行中，接受团体互例督导超过500小时，目前操受每周一次的个人互例督导，长期接只朋奉督导及团体督导，对抑郁，焦成，各类恐惧、心内性驱体症状等问愿有过大显的怀床研究和实钱。
<br/><br/>
[咨询对家]<br/>
1、心内性驱体症状人群;<br/>
2、抑部、糟种压力、聚张恐俱党成人咨询;<br/>
3、恋爱、婚烟帖感问源，家府关系问源;<br/>
4、人际关系困啡、小理创伤;<br/>
5、儿童。青少年心理与行为问题;<br/>
咨询取向:动力学治疗、认知行为治疗、整合性咨询。<br/><br/>
【咨询风格】<br/>
亲和，尊重，稿定、报持，原高陪件你一起探索内在，面对痛苦、重获喜乐。<br/>
[咨询师照对你说]<br/>
当你决定京咨询时，你也许已经在充满抑郁，恐惧、焦虑、强迫、不安、现独的“地狱”中坚持了很长一般时问，你之前努力地试着用各种办法早点逃奥，也许得尔一二次，一般时问暂时没有了，但最后还是痛芦的发规:始些还是“地狱”中，只不过在一个角落里四时好露 而已，这种心理上的痛苦、折磨只有经历过的人才期深深的体验到。因此，任何人在开始一段咨询前，不但满怀期特而目整见勇气，下定决心的，这是一个很不容另的过样。我知道这个出跌你的勇气和信任并不各易，因为要面对各种不研定及由此密起巨人的典虑贩，你是否原赛给自己一个机会去冒险为了想貌和期特中更好的自己?此刻，我不修承满你什么，风为这段将受开始的格程对我之说同样昂不确应的。，但我而意带着经由专业训练后的我及我本粤陪你一起大探客山实的你，按你的节来和步课，期法在这个过程中船助你时为操最成为的那个自己，过上你规最的生活，让你内心世界更无盈，罕和，要乐
<br/><br/>
[如何找到合话的咨询师]<br/>
我找到了适合自己的咨询师了吗?在咨询前，我要了解些什么呢?下两我引用从中老师的话家说明.<br/>
如何才修找到“最适合”你的咨询师呢?(从中)<br/><br/>
答:“最适合”你的咨询师，在你与他/地会谈的时候，会有以下三种感觉<br/><br/>
第一，你会感到，咨询师说的话，你修很容易、很轻悦地听明白他的意恩，你所说的话，咨询师也修很容易、很准响地埋解你的意恩，这样在你们的会谈中，你们一来一件地交谈着，你会感到你们之问的沟通很顺畅、不费劲儿<br/>
第二，在心理谈话过程中，你会豚到有兴趣，有热情与他/地继续会谈下去，一次谈完之后，你还会愿意约他/她进行下一次会误:<br/>
第三，在你与咨询师谈话的过程中，或者在会谈之后，你会觉得你自己受到了某些启发，让你对人，对事的旺解变得更丰窗、更广沟，更深入，更细败了，更修够了解自己和他人了，对工作，牛活和人际交件等更有自信心了。当你与莫位心坪咨询师遗话三至四次后，如果你获得了上述三种展觉，他就是你最活合的心坪咨询师!然后你就一定蒙坚持与设咨询师一起继统工作下去，要克服各种困难，坚持定明会谈，一直坚持到会谈的总次数达到20次以上.如果你与菜咨询师会谈了三四次之后，仍然无法找到上述这三种感觉，建议你赶要跟这位咨询,师说再见，然后大寻找下一个有可能成为“最适合”你的咨询师<br/><br/>
[也许你妈问]1、整个心理资询过职究南会花多少钱了<br/>
答:虽然由于每个个本的情况不同，我无法给出一个标准的，具体的数字。不过按职我常规的收费标准和咨询周期I每周一次，每次50分中计算，你需每月准备4000元用于支付咨询券用,而遥常绝人多数长期存在，或反复发生的心母困忧，需要进行少则3个月/12次、多则6个月/24次甚至更长时问的咨询，才修续得想的效果,当然,咨询效果是在过程·逐渐释放的并非要救个咨询过程结束才能体现出来<br/>
2整个心理咨询过程，需要多长时问 ?销卖回答这个问题，必须充分了解你的基本情况一比如困扰你的问题是什么，你拥有怎样的支持系统和生活环境，以及你对咨询目标的期中等等。而这些情况只然是非常个体化的，所以我 设有办法在不了部你的情况下，出一个现成的管客，但你可以在咨询过程中，直接 讨论这个问题从另一个角既说，咨询过程的长源也可以完全由你快定长程源程的咨询都部有所帮助。区刚在于咨询效果的深度，广度和持久度。因此通常情况下，不为咨询过程设定时限，能获得最理想咨询的效果。后时，任何时候一你觉得已经不再需是咨询的者助，都可以提出结灭咨询过程<br/>
3、心咨询真的有效吗?答:关于心理咨询，心理分析到底有没有效果，简单的回答是，只要你愿意开放自己的内心，坦诚地与咨询,师讨论你的只体情况，那就一定有效果一一区别是。获益的大小和改善的速魔，取决于你的投入程魔，咨询师的专业胡力心拜网扰存在的时问和强度，以及你对咨询目标期望的高低视个人情况差异，每一个咨询过程在开始阶段，都有1至4次的咨询，用以了解当事人的基本资料、评估问题的相关因素、讨论井决定咨询的大机方岗，我们道常把这个阶段叫做“切始访谈当初始访端阶段结点时，通常你会对接下京的咨询是否修帮助你，以及整个咨询、分析过程需要多长时问，都有直接的认识一-事实上如果你的咨询师只备较膏的专业水准，那么在始访谈的阶段中，你就已经可以感受到咨询市案的格助了<br/><br/>
个案时长<br/>
截止至2023年01月，时长10712小时<br/><br/>
专业成长<br/>
长期接受督导<br/><br/>
长期接受个人体验<br/>
擅长疗法<br/>
经典精神分析，沙盘疗法，家庭治疗，整合取向<br/>
咨询风格<br/>
亲和、稳定、开放、包容<br/>
培训经历<br/><br/>
2013.03--2015.07<br/>
东方心理分析研究院心理分析专业研究生课程<br/><br/>
2011.12-- 2012.12<br/>
客体关系心理治疗(高级班 )<br/><br/>
2008.04--2008.09<br/>
中德模式精神分析连续培训<br/><br/>
2015.07--2016.09<br/>
美国前任精神分析协会主席布莱克曼教授主讲的“穿越防御”<br/><br/>
2016.06--2017.03<br/>
心理咨询中的13个核心主题(张沛超)<br/><br/>
2013.06--2013.07<br/>
中国心理学会临床与咨询心理学首批注册督导师唐登华教授主讲的“家庭治疗”培训班<br/><br/>
2010.10-- 2011.07<br/>
许维索教授主讲的“焦点解决短程治疗进阶督导认证课程<br/><br/>
2016.07--2018.09<br/>
中英精神分析取向儿童青少年心理治疗连续培训项目<br/><br/>
2020.01-- 2020.03<br/>
徐凯文/咨询伦理:心理咨询师从业及自我保护必修<br/><br/>
2016.09--2019.07<br/>
东方心理分析研究院心理分析专业博士课程<br/><br/>
2020.01-- 2020.03<br/>
徐凯文:咨询伦理<br/>
               </div> -->
            </div>
          </el-card>
        </el-col>
        <el-col :span="1"> &nbsp; </el-col>
        <el-col :span="6">
          <el-card class="box-card m_t_b_5px" shadow="hover">
            <el-button
              type="primary"
              round
              style="width: 250px"
              @click="doConsult"
              >立即预约</el-button
            >
            <el-divider></el-divider>
            <el-button type="text" style="width: 250px; color: #a7a5a5"
              >查看可预约时段</el-button
            >
          </el-card>
        </el-col>
      </el-row>
    </div>

    <el-dialog :visible.sync="addPrivateLetterVisible">
      <div slot="title">私信</div>
      <template>
        <div style="height: 40vh; overflow-y: auto; overflow-x: hidden">
          <el-form
            :model="privateLetterForm"
            status-icon
            ref="privateLetterForm"
            label-width="80px"
            label-position="left"
            class="study-note-form"
          >
            <el-form-item label="内容" prop="letterContent">
              <el-input
                type="textarea"
                v-model="privateLetterForm.letterContent"
                autocomplete="off"
                maxlength="500"
                show-word-limit
                rows="8"
              ></el-input>
            </el-form-item>
            <el-form-item label="">
              <el-checkbox v-model="privateLetterForm.anonymity"
                >匿名</el-checkbox
              >
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="submitPrivateLetter"
                >提交</el-button
              >
            </el-form-item>
          </el-form>
        </div>
      </template>
    </el-dialog>

    <el-dialog :visible.sync="addThankLetterVisible">
      <div slot="title">感谢信</div>
      <template>
        <div style="height: 40vh; overflow-y: auto; overflow-x: hidden">
          <el-form
            :model="thankLetterForm"
            status-icon
            ref="thankLetterForm"
            label-width="100px"
            label-position="left"
            class="study-note-form"
          >
            <el-form-item label="感谢信内容" prop="letterContent">
              <el-input
                type="textarea"
                v-model="thankLetterForm.letterContent"
                autocomplete="off"
                maxlength="500"
                show-word-limit
                rows="8"
              ></el-input>
            </el-form-item>
            <el-form-item label="">
              <el-checkbox v-model="thankLetterForm.anonymity"
                >匿名</el-checkbox
              >
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="submitThankLetter"
                >提交</el-button
              >
            </el-form-item>
          </el-form>
        </div>
      </template>
    </el-dialog>

    <el-dialog :visible.sync="showLjyy">
      <div slot="title">立即预约</div>
      <template>
        <div style="height: 40vh; overflow-y: auto; overflow-x: hidden">
          <el-radio-group v-model="selectClassesId" style="line-height: 10vh">
            <el-radio v-for="obj in yyDateList" :label="obj.classesId">
              {{
                !obj.classesTime
                  ? ""
                  : obj.classesTime.length > 10
                  ? obj.classesTime.substr(0, 10)
                  : obj.classesTime
              }}
              <template v-if="obj.classesFlag == 1"> 上午 </template>
              <template v-if="obj.classesFlag == 2"> 下午 </template>
            </el-radio>
          </el-radio-group>
        </div>
      </template>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitLjyy">提交</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "ConsultDetail",
  data() {
    return {
      baseUrl: utils.baseURL,
      detail: {},
      thankLetterList: [],
      thankLetterListTop5: [],
      thankLetterForm: {}, //感谢信
      addPrivateLetterVisible: false,
      addThankLetterVisible: false,
      privateLetterForm: {},
      receiveDetailVisible: false,
      receiveUserList: [],
      receiveDeptList: [],
      receiveNextDeptList: [],
      receiveList: [],
      parentDept: {},
      deptHistory: [],
      showNext: false,
      selectDeptName: "", //选中的部门名称
      receiveParams: {}, //初始接收详情参数
      isShowThankLetterAll: true,
      articalList: [], //咨询师文章
      questionAnswerList: [], //咨询师回答列表
      questionAnswerListTop5: [], //咨询师回答列表 top5
      isShowQuestionAnswerAll: true,
      showLjyy: false,
      yyDateList: [],
      selectClassesId: 0,
    };
  },
  watch: {
    $route: "refresh",
  },
  computed: {},
  mounted() {
    var activeMenu =
      this.$route.query.activeMenu || "/LearningHome/PoliticalNews";
    this.$store.commit("updateActiveMenu", activeMenu);
    var id = this.$route.query.id;
    this.getDetail(id);
    utils.goTop();
  },
  methods: {
    registerDownnum(obj) {
      obj.downnum = parseInt(obj.downnum) + 1;
      this.$forceUpdate();
    },
    getDetail(id) {
      utils.post(
        "/psychic/psychicCounselor/get",
        { counselorId: id },
        (res) => {
          if (res.success) {
            this.detail = res.data;
            this.queryThankLetterList(id);
            this.queryArticalList(id);
            this.queryQuestionAnswer(id);
          }
        }
      );
    },
    //感谢信列表
    queryThankLetterList(id) {
      this.thankLetterListTop5 = [];
      utils.post(
        "/psychic/psychicCounselor/thankLetterList",
        { counselorId: id },
        (res) => {
          if (res.success) {
            this.thankLetterList = res.data.rows;
            if (this.thankLetterList.length > 5) {
              for (let i = 0; i < 5; i++) {
                const item = this.thankLetterList[i];
                this.thankLetterListTop5.push(item);
              }
            } else {
              this.thankLetterListTop5 = this.thankLetterList;
            }
          }
        }
      );
    },
    //咨询师文章列表
    queryArticalList(id) {
      utils.post(
        "/psychic/psychicCounselor/articalList",
        { counselorId: id },
        (res) => {
          if (res.success) {
            this.articalList = res.data.rows;
          }
        }
      );
    },
    queryQuestionAnswer(id) {
      this.questionAnswerListTop5 = [];
      utils.post(
        "/psychic/psychicCounselor/questionAnswer",
        { counselorId: id },
        (res) => {
          if (res.success) {
            this.questionAnswerList = res.data.rows;
            if (this.questionAnswerList.length > 5) {
              for (let i = 0; i < 5; i++) {
                const item = this.questionAnswerList[i];
                this.questionAnswerListTop5.push(item);
              }
            } else {
              this.questionAnswerListTop5 = this.questionAnswerList;
            }
          }
        }
      );
    },
    //关注
    addAttention() {
      utils.post(
        "/psychic/psychicCounselor/addAttention",
        { counselorId: this.detail.counselorId },
        (res) => {
          if (res.success) {
            this.$message.success("关注成功");
            this.detail.attention = 1;
          }
        }
      );
    },
    //取消关注
    cancelAttention() {
      var that = this;
      this.$confirm("确认取消关注？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        utils.post(
          "/psychic/psychicCounselor/cancelAttention",
          { counselorId: that.detail.counselorId },
          (res) => {
            if (res.success) {
              that.$message.success("操作成功");
              that.detail.attention = 0;
            }
          }
        );
      });
    },
    //私信
    doPrivateLetter() {
      this.addPrivateLetterVisible = true;
    },
    //提交私信
    submitPrivateLetter() {
      utils.post(
        "/psychic/psychicCounselor/addPrivateLetter",
        {
          counselorId: this.detail.counselorId,
          letterContent: this.privateLetterForm.letterContent,
          anonymity: this.privateLetterForm.anonymity ? 0 : 1,
        },
        (res) => {
          if (res.success) {
            this.$message.success("提交成功");
            this.privateLetterForm.letterContent = "";
            this.privateLetterForm.anonymity = false;
            this.addPrivateLetterVisible = false;
          }
        }
      );
    },
    decode(value) {
      let result = "";
      try {
        result = decodeURI(value);
      } catch (ex) {
        console.warn(ex);
        result = value;
      }
      return result == "undefined" ? "" : result;
    },
    showReceiveDetail() {
      this.fetchReceiveDetail(this.receiveParams);
    },
    fetchReceiveDetail(params, isBack) {
      let loadingInstance = this.Loading.service({
        fullscreen: true,
        lock: true,
        text: "拼命加载中...",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)",
      });
      this.selectDeptName = params.dept_name;
      const deptids = params.dept_id || "";
      params.i_id = this.detail.i_id;
      utils.post(
        "notice/receiveDetail",
        {
          i_id: params.i_id,
          deptids: deptids,
        },
        (res) => {
          loadingInstance.close();
          this.receiveDetailVisible = true;
          if (res.success) {
            this.receiveList = res.data;
            console.log(this.receiveList);
            if (!isBack) {
              this.deptHistory.unshift(params);
            }
          }
        }
      );
    },
    dialogBack() {
      this.deptHistory.shift();
      this.fetchReceiveDetail(this.deptHistory[0], true);
    },
    refresh(item) {
      this.getDetail(item.query.id);
    },
    doAddThankLetter() {
      this.addThankLetterVisible = true;
    },
    submitThankLetter() {
      utils.post(
        "/psychic/psychicCounselor/addThankLetter",
        {
          counselorId: this.detail.counselorId,
          letterContent: this.thankLetterForm.letterContent,
          anonymity: this.thankLetterForm.anonymity ? 0 : 1,
        },
        (res) => {
          if (res.success) {
            this.$message.success("提交成功");
            this.thankLetterForm.letterContent = "";
            this.thankLetterForm.anonymity = false;
            this.addThankLetterVisible = false;
            var id = this.$route.query.id;
            this.queryThankLetterList(id);
          }
        }
      );
    },
    showThankLetterAll() {
      this.thankLetterListTop5 = this.thankLetterList;
      this.isShowThankLetterAll = false;
    },
    closeThankLetterAll() {
      this.thankLetterListTop5 = this.thankLetterListTop5.slice(0, 5);
      this.isShowThankLetterAll = true;
    },
    showQuestionAnswerAll() {
      this.questionAnswerListTop5 = this.questionAnswerList;
      this.isShowQuestionAnswerAll = false;
    },
    closeQuestionAnswerAll() {
      this.questionAnswerListTop5 = this.questionAnswerList.slice(0, 5);
      this.isShowQuestionAnswerAll = false;
    },
    goNewsDetail(id) {
      this.$router.push({
        path: "/Cinziqao/Detail",
        query: { id: id, activeMenu: "/Cinziqao" },
      });
    },
    doConsult() {
      utils.post(
        "/psychic/psychicCounselor/listClass",
        {
          counselorId: this.detail.counselorId,
        },
        (res) => {
          if (res.success) {
            this.yyDateList = res.data.rows;
            if (this.yyDateList.length > 0) {
              this.showLjyy = true;
            } else {
              this.$message.error("暂无可预约时段");
            }
          }
        }
      );
    },
    submitLjyy() {
      if (this.selectClassesId == 0) {
        return;
      }
      utils.post(
        "/psychic/psychicCounselor/addAppoint",
        {
          counselorId: this.detail.counselorId,
          classesId: this.selectClassesId,
        },
        (res) => {
          if (res.success) {
            this.$message.success("预约成功");
            this.showLjyy = false;
          }
        }
      );
    },
  },
};
</script>
<style lang="less">
@primary-color: #cb2c21;
@bg-light-color: #de1632;

.xd-Cinziqao-Consult-ConsultDetail {
  .consult-detail-bg {
    position: absolute;
    top: 204px;
    width: 100%;
    height: 202px;
    background: url(../../../assets/imgs/xzq-bg-consult.png) repeat-x;
  }
  .el-radio__label {
    font-size: 16px;
    font-weight: bold;
  }
}
</style>
